package com.hn.zhijian.system.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hn.zhijian.base.service.IBaseService;
import com.hn.zhijian.system.entity.SysUser;
import com.hn.zhijian.system.model.request.UserRequest;
import com.hn.zhijian.system.model.response.UserResponse;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author carl chen
 * @since 2019-11-17
 */
public interface IUserService extends IBaseService<SysUser> {

    @Transactional
    public UserResponse save(UserRequest request);

    @Transactional
    public UserResponse update(UserRequest request);

    @Transactional
    public Integer del(Long id);

    public UserResponse get(Long id);

    public UserResponse get(String username);

    public SysUser getUser(String username);

    public List<UserResponse> getUsers(UserRequest request);

    public Page<UserResponse> getPage(Page<SysUser> page, UserRequest request);

    public Page<UserResponse> getUsers(Page<SysUser> page, String roleCode);

    public Integer modifyPassword(Long userId, String originalPassword, String newPassword);

    public UserResponse auth(String username, String password);
}
